﻿//vs
//#version 330 core

in vec3 inPosition;
in vec2 inUV;

uniform mat4 projectionMat;
uniform mat4 viewMat;
uniform mat4 modelMat;

out vec2 passUV;

void main(void) {
    gl_Position = projectionMat * viewMat * modelMat * vec4(inPosition, 1.0);
    passUV = inUV;
}

//fs
//#version 330 core

in vec2 passUV;

uniform sampler2DArray tex;
uniform int layerIndex;

layout(location = 0) out vec4 outColor;
//out vec4 outColor;

void main(void) {
    outColor = texture(tex, vec3(passUV, floor(layerIndex)));
}